import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getxdemo/app/appTheme.dart';
import 'package:getxdemo/app/injection_init.dart';
import 'package:getxdemo/res/string.dart';
import 'package:getxdemo/route/routers.dart';
import 'package:getxdemo/ui/page/splash_page/binding.dart';
import 'package:getxdemo/ui/page/splash_page/view.dart';
import 'package:getxdemo/utils/keyboard_util.dart';
import 'package:getxdemo/utils/locale_util.dart';

void main() async{
  WidgetsFlutterBinding.ensureInitialized();
  await Injection().init();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      getPages: Routes.routePages,
      debugShowCheckedModeBanner: false,
      initialRoute: "/",
      builder: (context,child)=> Scaffold(
        body: GestureDetector(
          onTap: (){
            KeyBoardUtil.hideKeyboard(context);
          },
          child: child,
        ),
      ),
      theme: appThemeData,
      translations: Messages(),
      locale: LocaleOptions.getDefult(),
      fallbackLocale: const Locale("zh","US"),
      initialBinding: SplashPageBinding(),
      home: const SplashPage(),
    );
  }
}






